import request from '@/utils/request'

/**
 * @description 查询企业部门列表接口
 * returns Promise
 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
 * @description 获取下拉员工数据接口
 */
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * @description 新增部门接口
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
 * @description 根据id获取部门详情接口
 */
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

/**
 * @description 编辑修改部门接口
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
/**
 * @description 根据id删除部门详情接口
 * @param {*} id
 * @returns
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'

  })
}
